package cn.chenyumeng.blog.dto;

import com.fasterxml.jackson.annotation.JsonFormat;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.util.Date;
import java.util.List;

/**
 * @program: blog->BlogDTO
 * @description:
 * @author: cg
 * @create: 2020-07-30 14:41
 **/
public class BlogDTO implements Serializable {

    private Long id;
    /**
     * 博客标题
     */
    @NotBlank(message = "博客标题不能为空")
    private String title;
    /**
     * 博客内容
     */
    @NotBlank(message = "博客内容不能为空")
    private String content;
    /**
     * 博客首图
     */
    private String firstPicture;
    /**
     * 博客标志（0原创、1转载、2翻译、3其他等）
     */
    @NotBlank(message = "博客标志必须选择")
    private String flag;
    /**
     * 浏览次数
     */
    private Integer views;
    /**
     * 赞赏开启(0开启 1不开启)
     */
    private String appreciation;
    /**
     * 转载声明开启(0开启 1不开启)
     */
    private String shareStatement;
    /**
     * 评论开启(0开启 1不开启)
     */
    private String commentabled;
    /**
     * 发布状态(0已发布 1未发布)
     */
    @NotBlank(message = "发布状态不能为空")
    private String published;
    /**
     * 是否推荐(0是 1否)
     */
    private String recommend;
    /**
     * 博客简要描述
     */
    @NotBlank(message = "博客简要描述不能为空")
    private String description;
    /**
     * 博客对应的分类Id
     */
    @NotNull(message = "博客对应的分类Id不能为空")
    private Long typeId;
    /**
     * 博客对应的标签Id集
     */
    @NotNull(message = "博客对应的标签Id集不能为空")
    private List<Long> tagIds;
    /**
     * 创建博客的用户Id
     */
    @NotNull(message = "创建博客的用户Id不能为空")
    private Long userId;
    /**
     * 博客评论次数
     */
    private Integer commentCount;
    /**
     * 创建时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date createTime;
    /**
     * 更新时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date updateTime;

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    public String getFirstPicture() {
        return firstPicture;
    }

    public void setFirstPicture(String firstPicture) {
        this.firstPicture = firstPicture;
    }

    public String getFlag() {
        return flag;
    }

    public void setFlag(String flag) {
        this.flag = flag;
    }

    public Integer getViews() {
        return views;
    }

    public void setViews(Integer views) {
        this.views = views;
    }

    public String getAppreciation() {
        return appreciation;
    }

    public void setAppreciation(String appreciation) {
        this.appreciation = appreciation;
    }

    public String getShareStatement() {
        return shareStatement;
    }

    public void setShareStatement(String shareStatement) {
        this.shareStatement = shareStatement;
    }

    public String getCommentabled() {
        return commentabled;
    }

    public void setCommentabled(String commentabled) {
        this.commentabled = commentabled;
    }

    public String getPublished() {
        return published;
    }

    public void setPublished(String published) {
        this.published = published;
    }

    public String getRecommend() {
        return recommend;
    }

    public void setRecommend(String recommend) {
        this.recommend = recommend;
    }

    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    public Date getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(Date updateTime) {
        this.updateTime = updateTime;
    }

    public Long getTypeId() {
        return typeId;
    }

    public void setTypeId(Long typeId) {
        this.typeId = typeId;
    }

    public Long getUserId() {
        return userId;
    }

    public void setUserId(Long userId) {
        this.userId = userId;
    }

    public List<Long> getTagIds() {
        return tagIds;
    }

    public void setTagIds(List<Long> tagIds) {
        this.tagIds = tagIds;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public Integer getCommentCount() {
        return commentCount;
    }

    public void setCommentCount(Integer commentCount) {
        this.commentCount = commentCount;
    }

    @Override
    public String toString() {
        return "BlogDTO{" +
                "id=" + id +
                ", title='" + title + '\'' +
                //", content='" + content + '\'' +
                ", firstPicture='" + firstPicture + '\'' +
                ", flag='" + flag + '\'' +
                ", views=" + views +
                ", appreciation='" + appreciation + '\'' +
                ", shareStatement='" + shareStatement + '\'' +
                ", commentabled='" + commentabled + '\'' +
                ", published='" + published + '\'' +
                ", recommend='" + recommend + '\'' +
                //", description='" + description + '\'' +
                ", typeId=" + typeId +
                ", tagIds=" + tagIds +
                ", userId=" + userId +
                ", commentCount=" + commentCount +
                ", createTime=" + createTime +
                ", updateTime=" + updateTime +
                '}';
    }

}
